# -*- coding: utf-8 -*-
from flask import Flask
from flask_script import Manager
from flask_sqlalchemy import SQLAlchemy
import os
from sqlalchemy import create_engine
from datetime import date,timedelta

app = Flask( __name__ )

manager = Manager( app )

app.config.from_pyfile( "config/base_setting.py" )
#ops_config=local|production
#linux export ops_config=local|production
#windows set ops_config=local|production
if "ops_config" in os.environ:
    app.config.from_pyfile( "config/%s_setting.py"%( os.environ['ops_config'] ) )

db = SQLAlchemy( app )


@app.template_filter('showmonth')
def showmonth(time):
    time1 = str(time)
    time2 = time1[0:7]
    return time2

@app.template_filter('tolist')
def tolist(company):
    companylist = company.split(',')
    return companylist

# @app.template_filter('huanhang')
# def huanhang(a):
#     a.replace("20", "6620")
#     return a



ExoskeletonEngine = create_engine('mysql+pymysql://root:116648728g@localhost:3306/exoskeleton')

# JarvisEngine = create_engine('mysql+pymysql://Jarvis:116648728gG@117.78.19.69:3306/jarvis')

